package com.coda.clouddisk.service.inter;

import com.coda.clouddisk.entity.KeSunAttachment;
import com.coda.clouddisk.entity.KesunReturn;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.net.MalformedURLException;
import java.util.Map;

public interface KeSunAttachmentService {
    /**
     * 文件上传
     */
    KesunReturn uploadFile(KeSunAttachment keSunAttachment, MultipartFile file);

    /**
     * 文件下载
     */
    ResponseEntity<Resource> downloadFile(String id) throws MalformedURLException;

    /**
     * 将文件添加进回收站
     * @param data
     * @return
     */
    KesunReturn toRubbish(Map<String, Object> data);

    /**
     * 按时间分类查找
     * @return
     */
    KesunReturn getFile(Map<String,Object> map);
}
